Skip to content

Replace spaces with underscores in generated default table name#791

Merged
adriengivry merged 1 commit into
Overload-Technologies:mainfrom
Gopmyc:788
May 1, 2026
Merged

Replace spaces with underscores in generated default table name#791
adriengivry merged 1 commit into
Overload-Technologies:mainfrom
Gopmyc:788

Conversation

@Gopmyc
Copy link
Copy Markdown
Contributor

@Gopmyc Gopmyc commented May 1, 2026

Description

This PR fixes the Lua default script template generation when a script filename contains spaces.

Previously, the generated identifier used the raw filename, which could produce invalid Lua syntax (e.g. local My Script = {}).
Now, spaces are replaced with underscores before generating the default Lua class/table/function identifiers.

Related Issue(s)

Fixes #788

Review Guidance

  • Main change is in LuaScriptEngineBase::GetDefaultScriptContent:
    • p_name is sanitized with " " -> "_" before template generation.
  • The sanitized name is used consistently in:
    • ---@class ...
    • local ... = {}
    • function ...:OnStart()
    • function ...:OnUpdate(deltaTime)
    • return ...
  • Scope is intentionally minimal and limited to default Lua template generation.

Screenshots/GIFs

N/A

AI Usage Disclosure

N/A

Checklist

  • My code follows the project's code style guidelines
  • When applicable, I have commented my code, particularly in hard-to-understand areas
  • When applicable, I have updated the documentation accordingly
  • My changes don't generate new warnings or errors
  • I have reviewed and take responsibility for all code in this PR (including any AI-assisted contributions)

@adriengivry adriengivry merged commit bf2c1f6 into Overload-Technologies:main May 1, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Replace spaces with underscores in generated default table name

2 participants